<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<style>
   *{
        margin: 0px;
        padding: 0px;
        list-style: none;
    }
    ul{
        width:800px;
      
        border: 1px solid red;
        /*将ul设置为弹性元素*/
        display: flex;
       
    }

    li{
        width: 100px;
        height: 100px;
        font-size: 50px;
        text-align: center;
        line-height: 100px;
    
        /*设置元素的基础大小,设置的是主轴上面的大小，这里主轴是width,如果主轴是列向排列，就为height*/
        /* flex-basis: 100px */


        /*flex 可以设置弹性元素的所有三个样式
        
           flex :grow shrink basis
        */
        flex: 1 1 auto;
    }
    li:nth-child(1){
        background-color: royalblue;
        /*元素的排列顺序 大的在主轴的后面，从小到大*/
      order: 3;
       
    }
    li:nth-child(2){
        background-color:red;
        order: 2;
    
    }
    li:nth-child(3){
        background-color: blueviolet;
      order: 1;
    }

</style>
<body>

      <ul>
          <li>1</li>
          <li>2</li>
          <li>3</li>
        
      </ul>
</body>
</html>
</html>